@echo off
echo.

rem Base variables for this script

set base="[Doki-Chihiro] Mashiroiro Symphony - 02 (1280x720 Hi10P BD FLAC) [417680C4].mkv"
set patched=[Doki-Chihiro] Mashiroiro Symphony - 02v2 (1280x720 Hi10P BD FLAC^) [B1D5AEFE].mkv
set program=xdelta3.exe
set patch=patch.delta

rem Check if user dropped a file to the script

IF not exist "%~1" goto normal

rem User dropped a file, override the variables

echo Patching %~n1%~x1
set program="%~d0%~p0xdelta3.exe"
set base=%1
if not "a%~1"=="a" if exist "%~d0%~p0%~1" set base=%~d0%~p0%~1
set patch=%~d0%~p0patch.delta
set patched=%~d1%~p1%patched%

goto startpatch
:normal

echo Attempting to patch %base%

:startpatch

echo.
%program% -d -s %base% "%patch%" "%patched%"
echo.

PAUSE

